import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(), tsconfigPaths()],
  server: {
    port: 3000,
    proxy: {
      '/fano/api': {
        target: 'http://localhost:8080', // Spring Boot应用的URL
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''), // 可根据需要调整路径
      },
    },
  }
})
